<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SWM34S_LVGL7.11_SWMUI: C:/Users/DELL/Desktop/Commit/lvgl/SWM34S_LVGL7.11_SWMUI_20230515/APP/UI/ui_update.h 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SWM34S_LVGL7.11_SWMUI<span id="projectnumber">&#160;V7.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_0ca16891106f5a3e9ad635a0d6c5f98f.html">APP</a></li><li class="navelem"><a class="el" href="dir_c78dc1806c68fd338fba226975244931.html">UI</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">函数</a>  </div>
  <div class="headertitle"><div class="title">ui_update.h 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p>启动引导更新页, 挂载文件系统实现 UI 素材导入/更新(可选模块)  
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &quot;SWM341.h&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
ui_update.h 的引用(Include)关系图:</div>
<div class="dyncontent">
<div class="center"><img src="ui__update_8h__incl.png" border="0" usemap="#a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_u_i_2ui__update_8h" alt=""/></div>
<map name="a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_u_i_2ui__update_8h" id="a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_u_i_2ui__update_8h">
<area shape="rect" title="启动引导更新页, 挂载文件系统实现 UI 素材导入/更新(可选模块)" alt="" coords="5,5,224,75"/>
<area shape="rect" title=" " alt="" coords="71,123,158,148"/>
</map>
</div>
</div><div class="textblock"><div class="dynheader">
此图展示该文件直接或间接的被哪些文件引用了:</div>
<div class="dyncontent">
<div class="center"><img src="ui__update_8h__dep__incl.png" border="0" usemap="#a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_u_i_2ui__update_8hdep" alt=""/></div>
<map name="a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_u_i_2ui__update_8hdep" id="a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_u_i_2ui__update_8hdep">
<area shape="rect" title="启动引导更新页, 挂载文件系统实现 UI 素材导入/更新(可选模块)" alt="" coords="5,5,224,75"/>
<area shape="rect" href="ui__update_8c.html" title="启动引导更新页, 挂载文件系统实现 UI 素材导入/更新(可选模块)" alt="" coords="5,123,224,192"/>
</map>
</div>
</div>
<p><a href="ui__update_8h_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:aea66c53fcc188fefaa3470555db6aa05"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ui__update_8h.html#aea66c53fcc188fefaa3470555db6aa05">ui_update</a> (void)</td></tr>
<tr class="memdesc:aea66c53fcc188fefaa3470555db6aa05"><td class="mdescLeft">&#160;</td><td class="mdescRight">启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新  <a href="ui__update_8h.html#aea66c53fcc188fefaa3470555db6aa05">更多...</a><br /></td></tr>
<tr class="separator:aea66c53fcc188fefaa3470555db6aa05"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p >启动引导更新页, 挂载文件系统实现 UI 素材导入/更新(可选模块) </p>
<p >/ </p><dl class="section since"><dt>自从</dt><dd>Change Logs: Date Author Notes 2022-12-08 lzh the first version 2022-12-21 lzh 将 SD 选项 与 初始启动默认加载方式 加入预编译, 34SCE 没有 SDIO 接口, 34SRE/VE 个别早期板子没焊 USB 接口(Type-A) 2023-02-23 lzh 修正消息框弹出同步问题 </dd></dl>
<dl class="section note"><dt>注解</dt><dd><br  />
 1、在 外部磁盘根目录中 不要放入太多文件, 会影响 <a class="el" href="ui__update_8c.html#affa34b514b9ff8d1f0d4e1f92df3f221" title="在已打开的目录下, 进行非递归搜寻文件, 并在 list 上刷新显示(文件数量上限由用户指定)">scan_dir_files()</a> 的扫描速度.(文件名也尽量不要太长, 字体滚动消耗资源较大, 视个人观感而定)</dd></dl>
<p>2、要使用 DFU (Device Firmware Update) 功能, 必须保证 MCU 片内已经存在 UserBoot , 否则复位后无法进入 UserBoot 进行固件更新, 程序挂死. (因为如果没有 Boot, 则 APP 地址从 0 开始, 会在修改 Chip-Flash 的数据时变向破坏原有 APP , 故复位后也无法执行原有 APP )</p>
<dl class="section remark"><dt>备注</dt><dd>使用说明: UI 启动引导更新页位于上电后第一个被调用的应用, 此时会弹出启动引导选项的消息框, 若点击 OK, 则进入文件列表拷贝页, 点击 Cancel 或 6s 超时不点击则退出本页面功能.</dd></dl>
<p>下拉列表:</p>
<p >SD : SDIO 接口, SD/TF卡(2 ~ 32GB)</p>
<p >USB_H : USB Host――MSC, 常见 U 盘(支持 USB2.0 全速/低速 )</p>
<p >USB_PC : USB Device――MSC, 连接个人电脑, MCU 利用板载 SPI-Flash 充当 U 盘设备</p>
<p >三颗独立功能按钮:</p>
<p >List : 左侧列表中已被点击的文件 更新拷贝至 本地磁盘 (如没有点击则直接进入下一步) , 下一步校验 本地 的文件素材表, 若校验通过则进入主菜单, 否则弹出错误提示</p>
<p >ALL : 先校验 外置存储 的文件素材表, 不符合直接抛出错误提示, 若符合则在外置存储的 &lt;根目录&gt; 下按 &lt;程序素材文件表&gt; 进行全拷贝至 本地存储 (会清空覆盖本地存储), 下一步校验 本地 的文件素材表, 若均校验通过则进入主菜单, 否则弹出错误提示</p>
<p >DFU : Device Firmware Update - 设备固件更新, 更新目标为移动磁盘列表中已被点击的文件&lt;默认选取最后点击的一个&gt;, 若没有点击选取文件, 则搜索默认配置文件名.</p>
<p >列表 :</p>
<p >左侧 : 显示 &lt;下拉列表选择的外置存储&gt; 的文件目录(对文件名进行过滤, 避免过多的文件干扰到用户选取, 过滤规则详见 - <a class="el" href="ui__update_8c.html#a69a8fdfac59efe32394ac287d886ad88" title="文件过滤器(仅针对外置存储)">file_filter_move()</a> )</p>
<p >右侧 : 默认为板载 SPI-Flash 的文件目录</p>
<p >列表下方按钮 : 翻页&lt;目前仅实现下一页功能&gt;</p>
<dl class="test"><dt><b><a class="el" href="test.html#_test000006">测试:</a></b></dt><dd>实际测试本例程的全部 UI 素材下载拷贝速度约 5 ~ 6 分钟.</dd></dl>
<dl class="section attention"><dt>注意</dt><dd></dd></dl>
<p>THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, SYNWIT SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONN- -ECTION WITH THEIR PRODUCTS.</p>
<dl class="section copyright"><dt>版权所有</dt><dd>2012 Synwit Technology </dd></dl>

<p class="definition">在文件 <a class="el" href="ui__update_8h_source.html">ui_update.h</a> 中定义.</p>
</div><h2 class="groupheader">函数说明</h2>
<a id="aea66c53fcc188fefaa3470555db6aa05" name="aea66c53fcc188fefaa3470555db6aa05"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aea66c53fcc188fefaa3470555db6aa05">&#9670;&#160;</a></span>ui_update()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t ui_update </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>: success </td></tr>
    <tr><td class="paramname">other</td><td>: error code </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>该功能为可选模块, 用户若不在规定时间内点击进入本功能, 将会超时自动跳出 </dd></dl>

<p class="definition">在文件 <a class="el" href="ui__update_8c_source.html">ui_update.c</a> 第 <a class="el" href="ui__update_8c_source.html#l00288">288</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="ui__update_8h_aea66c53fcc188fefaa3470555db6aa05_cgraph.png" border="0" usemap="#aui__update_8h_aea66c53fcc188fefaa3470555db6aa05_cgraph" alt=""/></div>
<map name="aui__update_8h_aea66c53fcc188fefaa3470555db6aa05_cgraph" id="aui__update_8h_aea66c53fcc188fefaa3470555db6aa05_cgraph">
<area shape="rect" title="启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新" alt="" coords="5,533,84,559"/>
<area shape="rect" href="ui__update_8c.html#a1a09f4ed59173b0220ba241a673ea3ec" title="开机启动引导消息框选择回调" alt="" coords="132,508,281,533"/>
<area shape="rect" href="ui__update_8c.html#a4b62aef18e10709cce125faee1b7dd52" title="文件管理器" alt="" coords="161,557,252,583"/>
<area shape="rect" href="ui__update_8c.html#a3dbd73c82f05a5370635333b5ed68aea" title="点击不同的按钮后, 由此函数执行对应动作" alt="" coords="347,255,441,280"/>
<area shape="rect" href="ui__update_8c.html#af7291cda4b568af469eecf3fbf3a7094" title="消息框弹出提示" alt="" coords="537,403,643,428"/>
<area shape="rect" href="ui__update_8c.html#a106a57df6249072c630361740348469e" title="销毁本页面所有控件" alt="" coords="337,456,451,481"/>
<area shape="rect" href="ui__update_8c.html#ac4bb8b84a1ae2abc7bd0419c4345bca2" title="选择不同加载方式后, 由此函数执行分支跳转" alt="" coords="329,557,459,583"/>
<area shape="rect" href="ui__update_8c.html#a69a8fdfac59efe32394ac287d886ad88" title="文件过滤器(仅针对外置存储)" alt="" coords="1264,696,1371,721"/>
<area shape="rect" href="load__file_8c.html#aebe4a0d647831986c734e1788150a064" title="为磁盘挂载文件系统" alt="" coords="751,383,826,408"/>
<area shape="rect" href="ui__update_8c.html#abed58d04a30c85fb2231dace9f928c23" title="列表内按钮" alt="" coords="904,784,1055,809"/>
<area shape="rect" href="ui__update_8c.html#affa34b514b9ff8d1f0d4e1f92df3f221" title="在已打开的目录下, 进行非递归搜寻文件, 并在 list 上刷新显示(文件数量上限由用户指定)" alt="" coords="1267,860,1368,885"/>
<area shape="rect" href="ui__update_8c.html#a0914c8a5cdee556dcabd181982c81260" title="创建本页面所用控件布局" alt="" coords="337,987,451,1012"/>
<area shape="rect" href="file__table_8c.html#a3b8264ecd2971c7f1409a78c16a80fff" title="按文件表依次验证磁盘文件" alt="" coords="533,255,647,280"/>
<area shape="rect" href="userboot_8c.html#a52a519a37465a7b4515a237114afa802" title="数据加密" alt="" coords="542,304,638,329"/>
<area shape="rect" href="userboot_8c.html#a759a4106353e92e06e9d15926228c576" title="固件下载 (外部 =&gt; 本地)" alt="" coords="525,104,655,129"/>
<area shape="rect" href="load__file_8c.html#a51d572edecc93d80a160b93843fb5208" title="磁盘新建卷, 重置清空卷" alt="" coords="946,153,1013,179"/>
<area shape="rect" href="userboot_8c.html#acdd804b92809fcd58b2bc135fc74666c" title="跳转至 UserBoot 执行对应动作" alt="" coords="527,55,653,80"/>
<area shape="rect" href="file__table_8c.html#ae9814059aade68167dd27fac6439fa67" title="按文件名链表拷贝文件并显示拷贝过程 UI" alt="" coords="515,353,665,379"/>
<area shape="rect" href="file__table_8c.html#a9f89967794eeb4df91c77da5f983e163" title="按文件表拷贝文件并显示拷贝过程 UI" alt="" coords="509,205,671,231"/>
<area shape="rect" href="userboot_8c.html#aeeea4715dd32a4a4ecdf61a2869d1307" title="计算 CRC 校验和" alt="" coords="739,104,838,129"/>
<area shape="rect" href="dev__crc_8c.html#a64e0abe6c28e0480424c1e467afb7430" title="计算 CRC32 校验和" alt="" coords="940,104,1019,129"/>
<area shape="rect" href="userboot_8c.html#a01aae38566ae3dd519a6c18696ab2806" title="重启 MCU" alt="" coords="747,5,830,31"/>
<area shape="rect" href="userboot_8c.html#a9412f435ea365342178b2399fc08a846" title="写入固件信息, 并自带回读校验" alt="" coords="733,55,844,80"/>
<area shape="rect" href="ui__update_8c.html#ad8390d39022fee758b6fb860c7906382" title="消息框事件回调" alt="" coords="725,333,852,359"/>
<area shape="rect" href="ui__update_8c.html#a623d03af25d3abe9fbe311d24d57ca28" title="消息框弹出期间的同步任务" alt="" coords="721,284,856,309"/>
<area shape="rect" href="load__file_8c.html#a054ac4b07b339f1cda65d041546a46f2" title="拷贝文件" alt="" coords="752,220,825,245"/>
<area shape="rect" href="ui__update_8c.html#a64ccaf85822f651235e20a08dfc2c500" title="SD / USB Host 检测插入介质" alt="" coords="539,608,641,633"/>
<area shape="rect" href="ui__update_8c.html#a8c94ec74d3a5db5ae3daed2ce3a5feaa" title="USB Device MSC 处理线程" alt="" coords="507,557,673,583"/>
<area shape="rect" href="load__file_8c.html#a2826c976bae07983300096521da284b4" title="为磁盘卸载文件系统" alt="" coords="935,203,1024,228"/>
<area shape="rect" href="ui__update_8c.html#ad08f050acf50e741aaa931f61b7dc00f" title="列表内按钮回调" alt="" coords="1115,784,1201,809"/>
<area shape="rect" href="_flash_disk_8c.html#a5ab90dc9341a1459125a15b506cfe35a" title="刷新脏缓冲区" alt="" coords="1261,456,1373,481"/>
<area shape="rect" href="_mass_storage_8c.html#aa02df815c14caedbc2fd0a8910d2e055" title=" " alt="" coords="751,432,826,457"/>
<area shape="rect" href="_mass_storage_8c.html#acc63e729ab9145b644fc4da28a63636e" title=" " alt="" coords="723,481,855,507"/>
<area shape="rect" href="_s_p_i___w_b25_qxx_8c.html#a65571e7929b299af3a763c206a2c98b5" title="擦除 WB25Qxx 指定扇区地址" alt="" coords="1421,407,1583,432"/>
<area shape="rect" href="_s_p_i___w_b25_qxx_8c.html#a0465c5f017965876cf6ff8859eb2731f" title="初始化 WB25Qxx 使用的 SPI 接口, 并读取芯片 ID 等信息以判断其是否是 WB25Qxx 芯片" alt="" coords="1449,456,1555,481"/>
<area shape="rect" href="_s_p_i___w_b25_qxx_8c.html#a6af72df055a5bc71064719f68842f515" title="向 WB25Qxx 指定地址处写入指定个字节数据(写入前须保证待写入区域已被擦空)" alt="" coords="1427,505,1577,531"/>
<area shape="rect" href="_s_p_i___w_b25_qxx_8c.html#a39809b92887312675a23a33bf9329fce" title="芯片忙检测(执行擦除、写入操作后需要执行忙检测以判断芯片是否已经完成操作)" alt="" coords="1659,407,1789,432"/>
<area shape="rect" href="_s_p_i___w_b25_qxx_8c.html#ae31db601e8f25e65389adda808c61e8d" title="设置 WEL 位, 使能写入(必须在每个擦除、写入状态寄存器和擦除/编程安全寄存器指令之前设置)" alt="" coords="1641,357,1807,383"/>
<area shape="rect" href="_s_p_i___w_b25_qxx_8c.html#a04c55a0ea26c3794552069171a06f868" title="进入 QPI 模式" alt="" coords="1649,456,1799,481"/>
<area shape="rect" href="_s_p_i___w_b25_qxx_8c.html#a8f90491088e0e7053d211def3f87a330" title="读取芯片 JEDEC ID" alt="" coords="1631,505,1817,531"/>
<area shape="rect" href="_mass_storage_8c.html#af04531d1a1fb99d20e8f895f621a3eb2" title=" " alt="" coords="910,304,1049,329"/>
<area shape="rect" href="dev__sfc_8c.html#aad5d116153c77313a1212733b556a578" title="初始化 SFC 将 外挂的SPI&#45;Flash 映射至 MCU 总线地址上" alt="" coords="1286,356,1349,381"/>
<area shape="rect" href="_flash_disk_8c.html#a7655b0f2f5afc564c640878be5a50d41" title="读取数据" alt="" coords="1103,456,1213,481"/>
<area shape="rect" href="_flash_disk_8c.html#ac9c9d4cc9fae5bccc09d1a80c7d42fc7" title="写入数据" alt="" coords="1103,356,1213,381"/>
<area shape="rect" href="_mass_storage_8c.html#a10afa6cfd9fc23db2b431ccf9f332f30" title=" " alt="" coords="1137,407,1179,432"/>
<area shape="rect" href="_mass_storage_8c.html#a27d5eea78a599a6b45519475e677ef2c" title=" " alt="" coords="920,456,1039,481"/>
<area shape="rect" href="ui__update_8c.html#abdb62d45c4cace1544f52cdacda45f24" title="注册本页面具备事件回调的控件" alt="" coords="549,987,631,1012"/>
<area shape="rect" href="ui__update_8c.html#a797b333b12a40decb2c24f829053576e" title="独立功能按钮" alt="" coords="725,1036,852,1061"/>
<area shape="rect" href="ui__update_8c.html#ab134d9ef6a82138c238684cb0af31fde" title="下拉选择加载方式" alt="" coords="727,987,850,1012"/>
<area shape="rect" href="ui__update_8c.html#aca1c2b29944838c9ab089bc024f238dc" title="列表外按钮点击翻页&#45;下一页" alt="" coords="722,866,855,906"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="ui__update_8h_aea66c53fcc188fefaa3470555db6aa05_icgraph.png" border="0" usemap="#aui__update_8h_aea66c53fcc188fefaa3470555db6aa05_icgraph" alt=""/></div>
<map name="aui__update_8h_aea66c53fcc188fefaa3470555db6aa05_icgraph" id="aui__update_8h_aea66c53fcc188fefaa3470555db6aa05_icgraph">
<area shape="rect" title="启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新" alt="" coords="227,5,305,31"/>
<area shape="rect" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102" title="Go to User App Execute" alt="" coords="104,5,179,31"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,5,56,31"/>
</map>
</div>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
